var layout = new Vue({
    el: '#layout-container',
    data: {
        url: './subform-zhuguan.html',
        li: {
            'Zhuguan': false,
            'Buzhu': true,
            'Dept': false,
            'Month': false
        },
        admin: false,
        dept: true,
        stu: true
    },
    methods: {
        /*实现iframe跳转*/
        ijump: function(str, info) {
            var _self = this;
            _self.li = {
                'Zhuguan': false,
                'Buzhu': false,
                'Dept': false,
                'Month': false
            };
            _self.li[info] = true;
            _self.url = str;
        },
        getRole: function() {
            var _self = this;
            var roleId = getCookie('role');
            console.log(roleId);
            if (roleId == 0) {
                _self.admin = false;
                _self.dept = false;
                _self.stu = false;
                _self.ijump('./subform-shenhe.html', 'Shenhe')
            } else if (roleId == 1) {
                _self.admin = true;
                _self.dept = false;
                _self.stu = true;
                _self.ijump("./subform-zhuguan.html", 'zhuguan')
            } else if (roleId == 2) {
                _self.admin = true;
                _self.dept = true;
                _self.stu = false;
                _self.url = "./subform-zhuguan.html";
            }


        },
        getCookie: function(c_name) {
                if (document.cookie.length > 0) {
                    c_start = document.cookie.indexOf(c_name + "=")
                    if (c_start != -1) {
                        c_start = c_start + c_name.length + 1
                        c_end = document.cookie.indexOf(";", c_start)
                        if (c_end == -1) c_end = document.cookie.length
                        return unescape(document.cookie.substring(c_start, c_end))
                    }
                }
                return ""
            }
            /*实现class的绑定*/
    }
});
layout.getRole();